<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class AddColumnInStepCategoryTable extends AbstractMigration
{
    public function up()
    {

        $this->table('step_category')
            ->addColumn('is_show', 'enum', ['default' => 'yes', 'null' => false, 'values' => "yes,no", 'comment' => '是否显示'])
            ->addColumn('is_enable_census', 'enum', ['default' => 'yes', 'null' => false, 'values' => "yes,no", 'comment' => '是否支持统计'])
            ->addColumn('show_name', 'string', ['default' => '', 'limit' => 255, 'comment' => '显示名称'])
            ->addColumn('show_index', 'string', ['default' => '', 'limit' => 255, 'comment' => '显示顺序'])
            ->save();
    }

    public function down()
    {
        $this->table('step_category')
            ->removeColumn('is_show')
            ->removeColumn('is_enable_census')
            ->removeColumn('show_name')
            ->removeColumn('show_index')
            ->save();
    }
}
